import { apiPrefix } from '@/consts/consts'

export default ({ $service:request, $dowloadService: dowloadService }) => ({
  // 5.2.1.分组列表
  getList(params) {
    return request({
      url: `${apiPrefix}/api/v1/property/list`,
      method: 'get',
      params
    })
  },

  // 5.4.2.新增参数
  add(data) {
    return request({
      url: `${apiPrefix}/api/v1/property/add`,
      method: 'post',
      data
    })
  },
  
  // 5.4.3.修改参数
  update(data, id) {
    return request({
      url: `${apiPrefix}/api/v1/property/update/${id}`,
      method: 'put',
      data
    })
  },
    
  // 5.2.4.删除分组
  delete(id) {
    return request({
      url: `${apiPrefix}/api/v1/property/delete/${id}`,
      method: 'delete',
    })
  },
      
  // 5.4.5.批量导入
  batch_import(data) {
    return request({
      url: `${apiPrefix}/api/v1/property/import`,
      method: 'post',
      data
    })
  },

  // 5.4.6.参数模板下载
  exportData() {
    return dowloadService({
      url: `${apiPrefix}/api/v1/property/export`,
      method: 'post',
    })
  },
})
